<?php

class Pages extends CI_Controller {

	public function view($page = 'home')
	{
		if ( ! file_exists('application/views/pages/'.$page.'.php'))
		{
			// Whoops, we don't have a page for that!
			show_404();
		}
		
		//mysql_connect('208.91.198.197:3306','susek','lizardjecar123') or die("uh oh: ".mysql_error());
		//mysql_connect('91.185.205.179:3306','tarja','4pYawrxN') or die("uh oh: ".mysql_error());
		//mysql_connect('freesql.org:3306','susek','lizardjecar123') or die("uh oh: ".mysql_error());
		mysql_connect("metfin.si:3306","metfinsi_klemen","klemen")  or die(mysql_error());
		
		$data['title'] = ucfirst($page); // Capitalize the first letter
		
		$this->load->view('templates/header', $data);
		$this->load->view('pages/'.$page, $data);
		$this->load->view('templates/footer', $data);
	
	}
}
	
?>